Conditions | 2 |
Total Lines | 13 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | import {Observer} from '@enbock/state-value-observer/ValueObserver'; |
||
18 | |||
19 | async loadModule(modulePath: string) { |
||
20 | let module: typeof React.Component; |
||
21 | |||
22 | 3 | if (!this.dictionary.hasOwnProperty(modulePath)) { |
|
23 | 2 | const filePath = (this.pathToRoot + modulePath + '.js').replace('.././', '../'); |
|
24 | 2 | module = (await import(filePath)).default as typeof React.Component; |
|
25 | 2 | this.dictionary[modulePath] = module; |
|
26 | } else { |
||
27 | 1 | module = this.dictionary[modulePath]; |
|
28 | } |
||
29 | |||
30 | 3 | this.moduleState.value = module; |
|
31 | } |
||
33 |